#$Id: tables.R 377 2009-03-03 04:06:26Z cameron.bracken $

n.days <- 5
path <- "~/Desktop/codes/brackish/inflow-model/"
rainfall.file <- paste(path,"rainfall",sep="")
inflow.file <- paste(path,"inflow",sep="")

try(library(xtable))
try(library(xtable,lib.loc='/home/acvmarsh/R/i686-pc-linux-gnu-library/2.8/'))

block.rainfall <- read.table(rainfall.file,fill=T,header=T, na.strings = "-9.00")
block.rainfall <- block.rainfall[(nrow(block.rainfall)-n.days):nrow(block.rainfall),]
block.rainfall[,3] <- format(as.POSIXct(paste(block.rainfall$year,
                                               block.rainfall$mo,
                                               block.rainfall$dy),
                                         tz="","%Y %m %d"),'%A, %B %d')
block.rainfall <- block.rainfall[,3:7]
names(block.rainfall) <- c('Date','3 Day','2 day','1 day','Observed')
rainfall <- xtable(block.rainfall)

block.inflow <- read.table(inflow.file,fill=T,header=T, na.strings = "-9.0000")
block.inflow <- block.inflow[(nrow(block.inflow)-n.days):nrow(block.inflow),]
block.inflow[,3] <- format(as.POSIXct(paste(block.inflow$year,
                                            block.inflow$mo,
                                            block.inflow$dy),
                                      tz="","%Y %m %d"),'%A, %B %d')
block.inflow <- block.inflow[,3:6]
names(block.inflow) <- c('Date','3 Day','2 day','1 day')
inflow <- xtable(block.inflow)
